package ollama

import "gitee.com/mkwchecking/sr-admin/pkg/instance"

type OllamaKey struct{}

func Instance(cfg ...Options) (*Ollama, error) {
	llama, err := instance.GetOrInit[*Ollama](OllamaKey{}, func() (*Ollama, error) {
		return New(cfg...)
	})
	if err != nil {
		return nil, err
	}

	return *llama, nil
}
